package com.chen.common;

public class BaseContext {

    private static final ThreadLocal<Long> THREAD_LOCAL= new ThreadLocal<>();

    //往ThreadLocal 里存对象
    public static void setCurrentId(Long id){
        THREAD_LOCAL.set(id);
    }
    //往ThreadLocal 里取对象
    public static Long getCurrentId(){
        return THREAD_LOCAL.get();
    }
}
